package com.example.shellshopping.utils;

import android.content.Context;

import java.io.File;

public class URLUtils {
    //内网公共部分
    //public static String PUBLIC_URL = "http://192.168.13.143:8080/beikeMarket";
    //外网公共部分
    public static String PUBLIC_URL = "http://47.100.26.130:8085/beikeMarke";

    //个人相关
    //注册接口
    public static String register_url = PUBLIC_URL+"/user/register";
    //登录接口
    public static String login_url = PUBLIC_URL+"/user/login";
    //更新/完善个人信息
    public static String updateInfo_url = PUBLIC_URL+"/user/updateInfo";
    //显示密保问题
    public static String showQuestion_url = PUBLIC_URL+"/user/showQuestion";
    //验证密保答案
    public static String verifyAnswer_url = PUBLIC_URL+"/user/verifyAnswer";
    //修改密码
    public static String updatePwd_url = PUBLIC_URL+"/user/updatePwd";

    //业务相关
    //查询所有分类
    public static String queryAllCategory_url = PUBLIC_URL+"/biz/queryAllCategory";
    //通过分类查询相应产品
    public static String queryCommodityByCateId_url = PUBLIC_URL+"/biz/queryCommodityByCateId?categoryId=";
    //商品的模糊查询
    public static String queryCommodityByName_url = PUBLIC_URL+"/biz/queryCommodityByName?name=";
    //商品详情
    public static String queryCommodityInfo_url = PUBLIC_URL+"/biz/queryCommodityInfo?commodityId=";
    //热销产品
    public static String hotCommodity_url = PUBLIC_URL+"/biz/hotCommodity";
    //产品推荐
    public static String recommendCommodity_url = PUBLIC_URL+"/biz/recommendCommodity";
    //猜你喜欢
    public static String guessYouLike_url = PUBLIC_URL+"/biz/guessYouLike";

    //购物相关
    //添加购物车
    public static String insertShoppingCar = PUBLIC_URL+"/trade/insertShoppingCar";
    //查询购物车
    public static String queryShoppingCar = PUBLIC_URL+"/trade/queryShoppingCar?userId=";
    //购物车中商品下单支付
    public static String orderShopping = PUBLIC_URL+"/trade/orderShopping";
    //直接购买（不进入购物车）
    public static String insertBought = PUBLIC_URL+"/trade/insertBought";
    //查询已购买商品
    public static String queryBought = PUBLIC_URL+"/trade/querybougth?userId=";

    public static String getImgPath(Context context,String name){
        String path = context.getExternalCacheDir()+
                File.separator+ name+ ".jpg";
        return path;
    }
}
